home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / himetr1r / frmoptio.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-14  |  20.7 KB  |  573 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmOptions 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Options"
  6.    ClientHeight    =   3525
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5970
  10.    BeginProperty Font 
  11.       Name            =   "Tahoma"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "frmOptions.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   3525
  24.    ScaleWidth      =   5970
  25.    ShowInTaskbar   =   0   'False
  26.    StartUpPosition =   3  'Windows Default
  27.    Begin VB.PictureBox picTabContainer 
  28.       Height          =   2535
  29.       Index           =   5
  30.       Left            =   2040
  31.       ScaleHeight     =   2475
  32.       ScaleWidth      =   3795
  33.       TabIndex        =   30
  34.       Top             =   4920
  35.       Width           =   3855
  36.       Begin VB.Frame fraHTML 
  37.          Caption         =   "HTML Options"
  38.          Height          =   2295
  39.          Left            =   120
  40.          TabIndex        =   31
  41.          Top             =   120
  42.          Width           =   3495
  43.          Begin VB.TextBox txtFooter 
  44.             Height          =   735
  45.             Left            =   1320
  46.             MultiLine       =   -1  'True
  47.             ScrollBars      =   3  'Both
  48.             TabIndex        =   35
  49.             Text            =   "frmOptions.frx":27A2
  50.             Top             =   1440
  51.             Width           =   2175
  52.          End
  53.          Begin VB.TextBox txtHeader 
  54.             Height          =   855
  55.             Left            =   1320
  56.             MultiLine       =   -1  'True
  57.             ScrollBars      =   3  'Both
  58.             TabIndex        =   33
  59.             Text            =   "frmOptions.frx":27B5
  60.             Top             =   360
  61.             Width           =   2175
  62.          End
  63.          Begin VB.Label lblFooter 
  64.             AutoSize        =   -1  'True
  65.             Caption         =   "Page Footer:"
  66.             Height          =   195
  67.             Left            =   120
  68.             TabIndex        =   34
  69.             Top             =   1560
  70.             Width           =   945
  71.          End
  72.          Begin VB.Label lblHeader 
  73.             AutoSize        =   -1  'True
  74.             Caption         =   "Page Header:"
  75.             Height          =   195
  76.             Left            =   120
  77.             TabIndex        =   32
  78.             Top             =   360
  79.             Width           =   990
  80.          End
  81.       End
  82.    End
  83.    Begin VB.CommandButton cmdCancel 
  84.       Caption         =   "&Cancel"
  85.       Height          =   375
  86.       Left            =   4800
  87.       TabIndex        =   29
  88.       Top             =   2880
  89.       Width           =   1095
  90.    End
  91.    Begin VB.CommandButton cmdOK 
  92.       Caption         =   "&OK"
  93.       Default         =   -1  'True
  94.       Height          =   375
  95.       Left            =   3600
  96.       TabIndex        =   28
  97.       Top             =   2880
  98.       Width           =   1095
  99.    End
  100.    Begin VB.PictureBox picTabContainer 
  101.       Height          =   2055
  102.       Index           =   4
  103.       Left            =   1800
  104.       ScaleHeight     =   1995
  105.       ScaleWidth      =   3915
  106.       TabIndex        =   18
  107.       Top             =   4680
  108.       Width           =   3975
  109.       Begin VB.Frame fraHeader 
  110.          Caption         =   "Header Options"
  111.          Height          =   1815
  112.          Left            =   120
  113.          TabIndex        =   19
  114.          Top             =   120
  115.          Width           =   3735
  116.          Begin VB.TextBox txtCompany 
  117.             Height          =   285
  118.             Left            =   1080
  119.             TabIndex        =   27
  120.             Top             =   1440
  121.             Width           =   2415
  122.          End
  123.          Begin VB.TextBox txtWeb 
  124.             Height          =   285
  125.             Left            =   1080
  126.             TabIndex        =   25
  127.             Top             =   1080
  128.             Width           =   2415
  129.          End
  130.          Begin VB.TextBox txtEmail 
  131.             Height          =   285
  132.             Left            =   1080
  133.             TabIndex        =   23
  134.             Top             =   720
  135.             Width           =   2415
  136.          End
  137.          Begin VB.TextBox txtName 
  138.             Height          =   285
  139.             Left            =   1080
  140.             TabIndex        =   21
  141.             Top             =   360
  142.             Width           =   2415
  143.          End
  144.          Begin VB.Label lblCompany 
  145.             AutoSize        =   -1  'True
  146.             Caption         =   "Company:"
  147.             Height          =   195
  148.             Left            =   120
  149.             TabIndex        =   26
  150.             Top             =   1440
  151.             Width           =   735
  152.          End
  153.          Begin VB.Label lblWeb 
  154.             AutoSize        =   -1  'True
  155.             Caption         =   "Web Site:"
  156.             Height          =   195
  157.             Left            =   120
  158.             TabIndex        =   24
  159.             Top             =   1080
  160.             Width           =   705
  161.          End
  162.          Begin VB.Label lblEmail 
  163.             AutoSize        =   -1  'True
  164.             Caption         =   "Email:"
  165.             Height          =   195
  166.             Left            =   120
  167.             TabIndex        =   22
  168.             Top             =   720
  169.             Width           =   420
  170.          End
  171.          Begin VB.Label lblName 
  172.             AutoSize        =   -1  'True
  173.             Caption         =   "Name:"
  174.             Height          =   195
  175.             Left            =   120
  176.             TabIndex        =   20
  177.             Top             =   360
  178.             Width           =   465
  179.          End
  180.       End
  181.    End
  182.    Begin VB.PictureBox picTabContainer 
  183.       Height          =   1575
  184.       Index           =   3
  185.       Left            =   1320
  186.       ScaleHeight     =   1515
  187.       ScaleWidth      =   3555
  188.       TabIndex        =   14
  189.       Top             =   4320
  190.       Width           =   3615
  191.       Begin VB.Frame fraInterface 
  192.          Caption         =   "Interface Options"
  193.          Height          =   1215
  194.          Left            =   120
  195.          TabIndex        =   15
  196.          Top             =   120
  197.          Width           =   2895
  198.          Begin VB.CheckBox chkTabs 
  199.             Caption         =   "Remember selected tabs"
  200.             Height          =   255
  201.             Left            =   120
  202.             TabIndex        =   17
  203.             Top             =   720
  204.             Width           =   2175
  205.          End
  206.          Begin VB.CheckBox chkSizes 
  207.             Caption         =   "Save positions on exit"
  208.             Height          =   255
  209.             Left            =   120
  210.             TabIndex        =   16
  211.             Top             =   360
  212.             Width           =   2535
  213.          End
  214.       End
  215.    End
  216.    Begin VB.PictureBox picTabContainer 
  217.       Height          =   1695
  218.       Index           =   2
  219.       Left            =   720
  220.       ScaleHeight     =   1635
  221.       ScaleWidth      =   3555
  222.       TabIndex        =   6
  223.       Top             =   3840
  224.       Width           =   3615
  225.       Begin VB.Frame fraColours 
  226.          Caption         =   "&Colourizing Options"
  227.          Height          =   1455
  228.          Left            =   120
  229.          TabIndex        =   7
  230.          Top             =   120
  231.          Width           =   4335
  232.          Begin VB.PictureBox picText 
  233.             BackColor       =   &H00000000&
  234.             Height          =   495
  235.             Left            =   2760
  236.             ScaleHeight     =   435
  237.             ScaleWidth      =   1275
  238.             TabIndex        =   13
  239.             Top             =   720
  240.             Width           =   1335
  241.          End
  242.          Begin VB.PictureBox picKeyword 
  243.             BackColor       =   &H00C00000&
  244.             Height          =   495
  245.             Left            =   1440
  246.             ScaleHeight     =   435
  247.             ScaleWidth      =   1155
  248.             TabIndex        =   11
  249.             Top             =   720
  250.             Width           =   1215
  251.          End
  252.          Begin VB.PictureBox picComment 
  253.             BackColor       =   &H00008000&
  254.             Height          =   495
  255.             Left            =   120
  256.             ScaleHeight     =   435
  257.             ScaleWidth      =   1155
  258.             TabIndex        =   9
  259.             Top             =   720
  260.             Width           =   1215
  261.          End
  262.          Begin VB.Label lblText 
  263.             AutoSize        =   -1  'True
  264.             Caption         =   "Text Colour"
  265.             Height          =   195
  266.             Left            =   2760
  267.             TabIndex        =   12
  268.             Top             =   360
  269.             Width           =   840
  270.          End
  271.          Begin VB.Label lblKeyword 
  272.             AutoSize        =   -1  'True
  273.             Caption         =   "Keyword Colour"
  274.             Height          =   195
  275.             Left            =   1440
  276.             TabIndex        =   10
  277.             Top             =   360
  278.             Width           =   1140
  279.          End
  280.          Begin VB.Label lblComment 
  281.             AutoSize        =   -1  'True
  282.             Caption         =   "Comment Colour"
  283.             Height          =   195
  284.             Left            =   120
  285.             TabIndex        =   8
  286.             Top             =   360
  287.             Width           =   1185
  288.          End
  289.       End
  290.    End
  291.    Begin VB.PictureBox picTabContainer 
  292.       Height          =   1695
  293.       Index           =   1
  294.       Left            =   360
  295.       ScaleHeight     =   1635
  296.       ScaleWidth      =   2955
  297.       TabIndex        =   1
  298.       Top             =   3600
  299.       Width           =   3015
  300.       Begin VB.Frame fraDatabase 
  301.          Caption         =   "&Database Options (At end of session)"
  302.          Height          =   1575
  303.          Left            =   120
  304.          TabIndex        =   2
  305.          Top             =   120
  306.          Width           =   2895
  307.          Begin VB.CheckBox chkRepair 
  308.             Caption         =   "Repair DB"
  309.             Height          =   255
  310.             Left            =   120
  311.             TabIndex        =   5
  312.             Top             =   1080
  313.             Width           =   1695
  314.          End
  315.          Begin VB.CheckBox chkCompact 
  316.             Caption         =   "Compact DB"
  317.             Height          =   255
  318.             Left            =   120
  319.             TabIndex        =   4
  320.             Top             =   720
  321.             Width           =   2415
  322.          End
  323.          Begin VB.CheckBox chkBackup 
  324.             Caption         =   "Backup DB"
  325.             Height          =   255
  326.             Left            =   120
  327.             TabIndex        =   3
  328.             Top             =   360
  329.             Width           =   2415
  330.          End
  331.       End
  332.    End
  333.    Begin ComctlLib.TabStrip tbsTab 
  334.       Height          =   2655
  335.       Left            =   0
  336.       TabIndex        =   0
  337.       Top             =   120
  338.       Width           =   5895
  339.       _ExtentX        =   10398
  340.       _ExtentY        =   4683
  341.       ImageList       =   "ImageList1"
  342.       _Version        =   327682
  343.       BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7} 
  344.          NumTabs         =   5
  345.          BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  346.             Caption         =   "Database"
  347.             Key             =   ""
  348.             Object.Tag             =   ""
  349.             Object.ToolTipText     =   "Database"
  350.             ImageVarType    =   8
  351.             ImageKey        =   "DB"
  352.          EndProperty
  353.          BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  354.             Caption         =   "Colourizing"
  355.             Key             =   ""
  356.             Object.Tag             =   ""
  357.             Object.ToolTipText     =   "Colourizing"
  358.             ImageVarType    =   8
  359.             ImageKey        =   "COLOUR"
  360.          EndProperty
  361.          BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  362.             Caption         =   "Interface"
  363.             Key             =   ""
  364.             Object.Tag             =   ""
  365.             Object.ToolTipText     =   "Interface"
  366.             ImageVarType    =   8
  367.             ImageKey        =   "UI"
  368.          EndProperty
  369.          BeginProperty Tab4 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  370.             Caption         =   "Header"
  371.             Key             =   ""
  372.             Object.Tag             =   ""
  373.             Object.ToolTipText     =   "Header"
  374.             ImageVarType    =   8
  375.             ImageKey        =   "HEADER"
  376.          EndProperty
  377.          BeginProperty Tab5 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  378.             Caption         =   "HTML"
  379.             Key             =   ""
  380.             Object.Tag             =   ""
  381.             Object.ToolTipText     =   "HTML"
  382.             ImageVarType    =   8
  383.             ImageKey        =   "HTML"
  384.          EndProperty
  385.       EndProperty
  386.    End
  387.    Begin ComctlLib.ImageList ImageList1 
  388.       Left            =   1800
  389.       Top             =   2880
  390.       _ExtentX        =   1005
  391.       _ExtentY        =   1005
  392.       BackColor       =   -2147483637
  393.       ImageWidth      =   16
  394.       ImageHeight     =   16
  395.       MaskColor       =   12632256
  396.       _Version        =   327682
  397.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  398.          NumListImages   =   5
  399.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  400.             Picture         =   "frmOptions.frx":27E8
  401.             Key             =   "COLOUR"
  402.          EndProperty
  403.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  404.             Picture         =   "frmOptions.frx":2944
  405.             Key             =   "DB"
  406.          EndProperty
  407.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  408.             Picture         =   "frmOptions.frx":2AA0
  409.             Key             =   "HEADER"
  410.          EndProperty
  411.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  412.             Picture         =   "frmOptions.frx":2BFC
  413.             Key             =   "HTML"
  414.          EndProperty
  415.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  416.             Picture         =   "frmOptions.frx":2D58
  417.             Key             =   "UI"
  418.          EndProperty
  419.       EndProperty
  420.    End
  421. Attribute VB_Name = "frmOptions"
  422. Attribute VB_GlobalNameSpace = False
  423. Attribute VB_Creatable = False
  424. Attribute VB_PredeclaredId = True
  425. Attribute VB_Exposed = False
  426. '----------------------------------------
  427. '- Name: Sam Huggill
  428. '- Email: sam@vbsquare.com
  429. '- Web: http://www.vbsquare.com/
  430. '- Company: Lighthouse Internet Solutions
  431. '- Date/Time: 14/08/99 11:33:18
  432. '----------------------------------------
  433. '- Notes:   Handles program options
  434. '----------------------------------------
  435. Option Explicit
  436. Private Const NumberOfTabs = 5
  437. Private Sub cmdCancel_Click()
  438.     Unload Me
  439. End Sub
  440. Private Sub cmdOK_Click()
  441.     '// Save settings to the registry
  442.     SaveSetting ThisApp, "Database", "Backup", chkBackup.Value
  443.     SaveSetting ThisApp, "Database", "Compact", chkCompact.Value
  444.     SaveSetting ThisApp, "Database", "Repair", chkRepair.Value
  445.     SaveSetting ThisApp, "General", "Sizes", chkSizes.Value
  446.     SaveSetting ThisApp, "General", "Remember Tabs", chkTabs.Value
  447.     SaveSetting ThisApp, "General", "Name", txtName
  448.     SaveSetting ThisApp, "General", "Email", txtEmail
  449.     SaveSetting ThisApp, "General", "Web", txtWeb
  450.     SaveSetting ThisApp, "General", "Company", txtCompany
  451.     SaveSetting ThisApp, "HTML", "Header", txtHeader.Text
  452.     SaveSetting ThisApp, "HTML", "Footer", txtFooter.Text
  453.     Unload Me
  454. End Sub
  455. Private Sub Form_Load()
  456.     Dim intTabIndex As Integer
  457.     Dim blnTab As Boolean
  458.     Dim intIndex As Integer
  459.     Dim intX As Integer
  460.     Dim blnBackup As Boolean
  461.     Dim blnRepair As Boolean
  462.     Dim blnCompact As Boolean
  463.     Dim intSizes As Integer
  464.     '// Get settings from the registry
  465.     '// and set-up the tabs
  466.     For intX = 1 To NumberOfTabs
  467.         With picTabContainer(intX)
  468.             .BorderStyle = 0
  469.             .left = tbsTab.ClientLeft
  470.             .tOp = tbsTab.ClientTop
  471.             .Width = tbsTab.ClientWidth
  472.             .Height = tbsTab.ClientHeight
  473.             .Visible = False
  474.         End With
  475.     Next intX
  476.     blnTab = GetSetting(ThisApp, "General", "Remember Tabs", True)
  477.     If blnTab = True Then
  478.         intTabIndex = Val(GetSetting(ThisApp, "General", "Options", 1))
  479.         '// Thanks to Randy Ledyard
  480.         If intTabIndex = 0 Then intTabIndex = 1
  481.         tbsTab.Tabs(intTabIndex).Selected = True
  482.     End If
  483.     fraColours.Move ScaleLeft + 15, ScaleTop + 15, picTabContainer(1).Width - 15, picTabContainer(1).Height - 15
  484.     fraDatabase.Move ScaleLeft + 15, ScaleTop + 15, picTabContainer(1).Width - 15, picTabContainer(1).Height - 15
  485.     fraHeader.Move ScaleLeft + 15, ScaleTop + 15, picTabContainer(1).Width - 15, picTabContainer(1).Height - 15
  486.     fraInterface.Move ScaleLeft + 15, ScaleTop + 15, picTabContainer(1).Width - 15, picTabContainer(1).Height - 15
  487.     fraHTML.Move ScaleLeft + 15, ScaleTop + 15, picTabContainer(1).Width - 15, picTabContainer(1).Height - 15
  488.     blnBackup = GetSetting(ThisApp, "Database", "Backup", False)
  489.     blnRepair = GetSetting(ThisApp, "Database", "Repair", False)
  490.     blnCompact = GetSetting(ThisApp, "Database", "Compact", False)
  491.     intSizes = GetSetting(ThisApp, "General", "Sizes", 1)
  492.     txtName = GetSetting(ThisApp, "General", "Name", "")
  493.     txtEmail = GetSetting(ThisApp, "General", "Email", "")
  494.     txtWeb = GetSetting(ThisApp, "General", "Web", "")
  495.     txtCompany = GetSetting(ThisApp, "General", "Company", "")
  496.     If blnBackup Then
  497.         chkBackup.Value = 1
  498.     Else
  499.         chkBackup.Value = 0
  500.     End If
  501.     If blnRepair Then
  502.         chkRepair.Value = 1
  503.     Else
  504.         chkRepair.Value = 0
  505.     End If
  506.     If blnCompact Then
  507.         chkCompact.Value = 1
  508.     Else
  509.         chkCompact.Value = 0
  510.     End If
  511.     chkSizes.Value = intSizes
  512.     If blnTab Then
  513.         chkTabs.Value = 1
  514.     Else
  515.         chkTabs.Value = 0
  516.     End If
  517.     picComment.BackColor = Val(GetSetting(ThisApp, "Colour", "Comment", RGB(0, 127, 0)))
  518.     picKeyword.BackColor = Val(GetSetting(ThisApp, "Colour", "Keyword", RGB(0, 0, 127)))
  519.     picText.BackColor = Val(GetSetting(ThisApp, "Colour", "Text", RGB(0, 0, 0)))
  520.     CentreForm Me
  521.     fraColours.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
  522.     fraDatabase.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
  523.     fraHeader.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
  524.     fraInterface.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
  525.     fraHTML.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
  526.     txtHeader.Width = fraHTML.Width - (txtHeader.left * 1.5)
  527.     txtFooter.Width = fraHTML.Width - (txtFooter.left * 1.5)
  528.     txtHeader = GetSetting(ThisApp, "HTML", "Header", txtHeader.Text)
  529.     txtFooter = GetSetting(ThisApp, "HTML", "Footer", txtFooter.Text)
  530. End Sub
  531. Private Sub Form_Unload(Cancel As Integer)
  532.     Dim intTabIndex As Integer
  533.     Dim blnTab As Boolean
  534.     '// Save the current tab
  535.     blnTab = GetSetting(ThisApp, "General", "Remember Tabs", True)
  536.     If blnTab = True Then
  537.         SaveSetting ThisApp, "General", "Options", tbsTab.SelectedItem.Index
  538.     End If
  539. End Sub
  540. Private Sub picComment_Click()
  541.     Dim lngColour As Long
  542.     lngColour = ChooseColour(Me.hwnd)
  543.     If lngColour <> -1 Then
  544.         picComment.BackColor = lngColour
  545.         frmMain.ctlData1.Comment lngColour
  546.     End If
  547. End Sub
  548. Private Sub picKeyword_Click()
  549.     Dim lngColour As Long
  550.     lngColour = ChooseColour(Me.hwnd)
  551.     If lngColour <> -1 Then
  552.         picKeyword.BackColor = lngColour
  553.         frmMain.ctlData1.Keyword lngColour
  554.     End If
  555. End Sub
  556. Private Sub picText_Click()
  557.     Dim lngColour As Long
  558.     lngColour = ChooseColour(Me.hwnd)
  559.     If lngColour <> -1 Then
  560.         picText.BackColor = lngColour
  561.         frmMain.ctlData1.TextC lngColour
  562.     End If
  563. End Sub
  564. Private Sub tbsTab_Click()
  565.     Static PrevTab As Integer
  566.     PrevTab = Switch(PrevTab = 0, 1, PrevTab >= 1 And PrevTab <= NumberOfTabs, PrevTab)
  567.     picTabContainer(PrevTab).Visible = False
  568.     picTabContainer(tbsTab.SelectedItem.Index).Visible = True
  569.     picTabContainer(tbsTab.SelectedItem.Index).Refresh
  570.     PrevTab = tbsTab.SelectedItem.Index
  571.     DoEvents
  572. End Sub
  573.